
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "billing");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style >
	#outStockInfoCopy{display:none}
	.thumbnail{margin: 0px}
	#logo{margin: 0px;padding: 0px;}
	#pic{padding: 0px;height:60px;width:60px;}
	td input{margin-top:-1px;margin-bottom:-1px;height:21px; width:98%;border:none;color:red}
	body{
		font-size:9px ;
		font-family:黑体,微软雅黑;
		overflow:hidden; 
	}
	.panel-body{
		overflow:auto;
	}
	.table{
		border:black 1px solid !important;
	}
	.table tr th{
		border:black 1px solid !important;
		text-align: center;
		padding:0px 2px !important;
	}
	.table tr td{	
		border:black 1px solid !important;
		padding:0px 2px !important;
		text-align: center;
	}
	textarea{
		line-height: 0.5 !important;
	}
</style>
<script type="text/javascript">
function print(){
	top.openModal("/billing/billingPrint/electricalPrint?key="+$("#billingId").val()+"&describe="+$("#describe").val(),"print_form","打印详情",1200,550);
}
function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}
	
function actionResultCallBack(){
	var result={close:false,refresh:true};
	
	top.main.formSubmit();
	
	return result;
}
	
</script>
<t:panel cssClass="panel-flat form-detailed border-top-primary border-top-xlg minHight" customBody="true" customHead="true">
	 <t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
	 	<t:button icon="icon-floppy-disk" onclick="saveData()" laddaType="progress" cssClass="btn-info" csize="sm">保存</t:button>
		<t:button icon="icon-floppy-disk" onclick="print()" laddaType="progress" cssClass="btn-info" csize="sm">打印</t:button>
	</t:panelFoot>
	<div class="detailed-navbar-content panel-body">
		<t:form id="billingPrint" modelAttribute="billingPrint" action="/billing/billingPrint/save" method="post" cssClass="form-horizontal">
			 <input type="hidden" id="billingId" name="billingId" value="${billing.billingId }"/>
			 <div class="hide">
				 <t:hidden path="printId"/>
 				 <t:hidden path="deleteMark"/>	
 				 <t:hidden path="createUserName"/>
		 		 <t:hidden path="createUserId"/>
		 		 <t:hidden path="createDate"/>
		 		 <t:hidden path="shopId"/>
		 		 
		 		 <input type="hidden" id="printType" name="printType" value="electrical"/>
		 		 
			</div>
			<div id="printContent" >
				<div class="text-center"><h3>${shop.shopName}销售单</h3></div>
					<table style="width:100%" border="0">
				   <div class="row">
				    	<div class="col-md-4 col-sm-4">客户：${billing.customer.customerName}</div>
				    	<div class="col-md-4 col-sm-4">开单日期：<fmt:formatDate value="${billing.createDate}" type="date" dateStyle="default" pattern="yyyy-MM-dd"/></div>
				    	<div class="col-md-4 col-sm-4">订单号：${billing.billingNo}</div>
				    </div>
				    <div class="row">
				    	<div class="col-md-4 col-sm-4">收货地址：${billing.address}</div>
				    	<div class="col-md-4 col-sm-4">联系电话：${billing.customer.customerTel}</div>
				    	<div class="col-md-4 col-sm-4">欠款：${billing.unpaidAmount}</div>
				    </div>
				   <tr>
				   	  
				   	  
				   </tr>   	    
				</table>
				<table class="table " style="margin-top:10px;">
					<tr>
						<th style="width:50px">序号</th>
			           	<th style="width:100px">条形码</th>
			           	<th style="width:100px">商品名称</th>
			           	
			           	<th style="width:200px">规格</th>
			           	
			           	<th style="width:100px">单位</th>
			           	<th style="width:100px">数量</th>
			           	<th style="width:100px">单价</th>
			           	<th style="width:100px">小计</th>
					</tr>
					<c:set var="nullAll"  value="0"/>
					<c:set var="realPriceAll"  value="0"/>
					<c:set var="sequence"  value="0"/>
					<c:forEach var="outStockShow" items="${billing.outStock.outStockShows}">
						<c:forEach var="outStockCollocation" items="${outStockShow.outStockCollocations}" >
							<c:set var="nullAll"  value="${nullAll +outStockCollocation.collocationNum}"/>
							<c:set var="realPriceAll"  value="${realPriceAll +outStockCollocation.realPrice*outStockCollocation.collocationNum}"/>
							<tr id="outStockCollocation_${sequence}">
			
								<td>${sequence +1}</td>				
				            	<td>${outStockShow.cargo.shapeCode}</td>
				            	<td>${outStockShow.cargo.cargoName}</td>
				            	<td>${outStockCollocation.collocation.propertyNameOne}*${outStockCollocation.collocation.propertyNameTwo}</td>
				            	
								<td>${outStockShow.cargo.unit}</td>
								<td>${outStockCollocation.collocationNum}</td>
								<td>${outStockCollocation.realPrice}</td>
								<td>${outStockCollocation.realPrice*outStockCollocation.collocationNum}</td>
							</tr>
							<c:set var="sequence"  value="${sequence +1}"/>
						</c:forEach>
					</c:forEach>
					<tr>
						<td colspan="2">合计:</td>
						<td colspan="3">${tfn:toChinaMoney(realPriceAll)}</td>
						<th >${nullAll}</th>
			           	<th ></th>
			           	<th >${realPriceAll}</th>
					</tr>
					</table>
				
					<t:formgroup>
		            	<label for="describe" class="col-sm-1 col-xs-1 control-label cursor-pointer text-right">备注</label>
		                <div class="col-sm-11 col-xs-11">
		                <input id="describe"  class="form-control custom-input" data-control-type="input" data-ts-forcestepdivisibility="none" type="text" value="" placeholder="请输入">
		               
		                </div>
		            </t:formgroup>
		            <t:formgroup>
		            	<t:label path="work" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="work" colClass="col-sm-3 col-xs-3" />
		                <t:label path="CCB" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="CCB" colClass="col-sm-3 col-xs-3" />
		                <t:label path="ABC" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="ABC" colClass="col-sm-3 col-xs-3" />
		            </t:formgroup>
		            <t:formgroup>
		            	<t:label path="address" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="address" colClass="col-sm-3 col-xs-3" />
		                <t:label path="tel" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="tel" colClass="col-sm-3 col-xs-3" />
		                <t:label path="QQ" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="QQ" colClass="col-sm-3 col-xs-3" />
		            </t:formgroup>
		            <t:formgroup>
		            	<t:label path="myUrl" cssClass="col-sm-1 col-xs-1" />
		                <t:input path="myUrl" colClass="col-sm-3 col-xs-3" />
		                <t:label path="customerSign" cssClass="col-sm-1 col-xs-1" />
		                <t:input readonly="true" path="customerSign" colClass="col-sm-3 col-xs-3" />
		            </t:formgroup>
			</div>
		</t:form>
	</div>

</t:panel>


<script type="text/javascript">
$(function(){
	tabpaneResize();

})

function tabpaneResize(){
	$(".panel-body").height($(window).height() - 70);
	
}
</script>

<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
